#!/usr/bin/env python
# -*-coding:utf-8-*-
# File    : liyuqi.py

import requests

def sendmsg(hookurl, msg):
    json_data = {
        "msgtype": "text",
        "text": {
            "content": msg
        }}
    requests.post(hookurl, json=json_data)

if __name__ == '__main__':
    #机器人webhook链接，生成企业微信机器人时，界面会显示
    myroot_url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxx"
    #要发送的消息内容,更多玩法可以参考企业微信官方文档
    message = "大家好，我是一个机器人"
    sendmsg(myroot_url, message)